<template>
  <div class="list">
    <!-- 多少行后加省略号 -->
    <!-- 目前没加 -->
    <div class="box">
      <div class="item" v-for="(item,index) in list" :key="index"  @click="godetails(item.id,item.name)">
        <div class="xinxi">
          <p class="p1">{{item.name}}</p>
          <p class="p2">{{item.ingredient}}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        list:'',
        secondid:'',
      }
    },
    created() {
      this.secondid=this.$route.query.secondid
      this.getlist()
    },
    mounted(){
      
    },
    methods: {
      // 获取药品名称
      getlist(){
        console.log(this.secondid,'this.secondid')
        this.$get("api/gzh_index.php?action=yaoli_goods_list", {
          yt_id:this.secondid
        }).then(res => { 
          this.list = res.data
        }).catch(err => {
          
        });
      },
      // 跳转药品详情
      godetails(id,title){
        this.$router.push({name:'pathology-query-details',query: {id:id,title:title}}) 
      }
    },
  }
</script>

<style scoped>
.list{
  width: 100%;
}

.box{
  width:691px;
  margin: auto;
}
.item{
  width: 100%;
  border-bottom: 1PX solid #EBEBEB;
  display: flex;
  align-items: center;
  padding: 30px 0;
}
.item .xinxi{
  width: 100%;
}
.p1{
  font-size:30px;
  font-family:PingFang SC;
  font-weight:bold;
  color:rgba(0,0,0,1);
  line-height:40px;
}
.p2{
  font-size:26px;
  font-family:PingFang SC;
  font-weight:500;
  color:rgba(51,51,51,1);
  line-height:40px;
  margin-top: 10px;
  /* margin-bottom: 35px; */
}
</style>
